package waal.pc.backend.channels;


public class ChannelEvent {
	
	private int event;
	private Channel channel;
	private boolean digital, input;
	

	public ChannelEvent(int event, DigitalChannel channel) {
		this.event = event;
		this.channel = channel;
		this.digital = true;
		this.input = true;
	}
	
	public ChannelEvent(int event, AnalogChannel channel) {
		this.event = event;
		this.channel = channel;
		this.digital = false;
		this.input = true;
	}
	
	public ChannelEvent(int event, DigitalOutputChannel channel) {
		this.event = event;
		this.channel = channel;
		this.digital = true;
		this.input = false;
	}
	
	public ChannelEvent(int event, AnalogOutputChannel channel) {
		this.event = event;
		this.channel = channel;
		this.digital = false;
		this.input = false;
	}
	

	public int getEvent() {
		return this.event;
	}
	
	public Channel getChannel() {
		return this.channel;
	}
	
	public boolean isDigital() {
		return this.digital;
	}
	
	public boolean isInput() {
		return this.input;
	}
		
	
	public String getEventText() {
		switch(this.event) {
		case 1:
			return "Channel added";
		case 2:
			return "Channel remove";
		case 3: 
			return "Channel change active state";
		default:
			return "Unkown Event";
		}
	}
}
